<template>
  <div class="handlerBar">
    <div class="handlerBar__item" v-for="item in handlerBtns" :key="item.name">
      <el-button
        :class="[`${item.class}btn`, 'handlerBtn']"
        :type="item.type"
        :plain="item.plain"
        :icon="item.icon"
        :disabled="!item.condition"
        @click="item.func"
      >
        {{ item.name }}
      </el-button>
    </div>
  </div>
</template>

<script setup lang="ts" name="handlerBar">
type HandlerBtns = {
  class: string;
  name: string;
  type: any;
  icon: any;
  plain: boolean;
  func?: Function;
  condition?: boolean;
};
defineProps<{ handlerBtns: HandlerBtns[] }>();
</script>

<style scoped lang="scss">
.handlerBar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.handlerBtn {
  padding: 0 20px;
  margin: 0 15px;
}
</style>
